//
//  TernaryDemo.swift
//  SwiftUIDemo
//
//  Created by Tilt Wang on 2025/6/28.
//

import SwiftUI

struct TernaryDemo: View {
    
    @State var isStartingState: Bool = false
    
    var body: some View {
        VStack {
            Button("Button: \(isStartingState.description)") {
                isStartingState.toggle()
            }
            RoundedRectangle(cornerRadius: 25)
                .fill(isStartingState ? .red: .blue)
                .frame(width: 200, height: 100)
            Spacer()
        }
    }
}

#Preview {
    TernaryDemo()
}
